package com.jichangxiu.framework.factory;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.jichangxiu.framework.service.InfoRuleService;
import com.jichangxiu.framework.service.impl.DefaultInfoRuleServiceImpl;

public class InfoRuleServiceFactory {

    public static InfoRuleService infoRuleService() {
        InfoRuleService infoRuleService;
        try {
            infoRuleService = SpringUtil.getBean(InfoRuleService.class);
            if (ObjectUtil.isEmpty(infoRuleService))
                infoRuleService = new DefaultInfoRuleServiceImpl();
        } catch (Exception exception) {
            infoRuleService = new DefaultInfoRuleServiceImpl();
        }
        return infoRuleService;
    }

}
